package com.itheima02;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;

public class Work01 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("day11_demo\\info1.txt");
        HashSet<Integer> set = new HashSet<>();
        int i;
        while ((i = fis.read()) != -1) {
            set.add(i);
        }
        FileOutputStream fos = new FileOutputStream("day11_demo\\info1.txt");
        for (Integer integer :  set) {
            fos.write(integer);
        }
        FileInputStream fis1 = new FileInputStream("day11_demo\\info1.txt");
        while ((i = fis1.read()) != -1) {
            System.out.println((char)fis1.read());
        }
    }
}

